package com.web.system.po;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.*;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

@Entity
@Table(name="t_userinfo")
public class UserPo implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 5001663548331928658L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY) 
	private Integer userId;
	private String userName;
	private String password;
	private String idCard;
	private String userSex;
	private Date erollTime;
	private String telephone;
	private String address;
	private Date birthday;
	private String email;
	private Date loginTime;
	private Integer isDelete;
	@ManyToMany
	@JoinTable(
        name="t_sys_user_role",
        joinColumns={@JoinColumn(name="user_id")},
        inverseJoinColumns={@JoinColumn(name="role_id")}
	)
	@Fetch(value = FetchMode.SELECT)
	@LazyCollection(value = LazyCollectionOption.TRUE)
	private List<RolePo> roleBeans = new ArrayList<RolePo>();

	public Integer getUserId() {
		return userId;
	}
	public void setUserId(Integer userId) {
		this.userId = userId;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getUserSex() {
		return userSex;
	}
	public void setUserSex(String userSex) {
		this.userSex = userSex;
	}
	public Date getErollTime() {
		return erollTime;
	}
	public void setErollTime(Date erollTime) {
		this.erollTime = erollTime;
	}
	public String getTelephone() {
		return telephone;
	}
	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public List<RolePo> getRoleBeans() {
		return roleBeans;
	}
	public void setRoleBeans(List<RolePo> roleBeans) {
		this.roleBeans = roleBeans;
	}
	public String getIdCard() {
		return idCard;
	}
	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}
	public Date getLoginTime() {
		return loginTime;
	}
	public void setLoginTime(Date loginTime) {
		this.loginTime = loginTime;
	}
	public Integer getIsDelete() {
		return isDelete;
	}
	public void setIsDelete(Integer isDelete) {
		this.isDelete = isDelete;
	}
	
}
